#include <windows.h>

class Tool {
public:
    Tool() {
        _inst = this; 
    }
    
    static void run(HINSTANCE inst, const char* cmdLine) {
        _inst->start(inst, cmdLine);
    }

protected:
    virtual void start(HINSTANCE inst, const char* cmdLine) = 0;

private:
    static Tool* _inst;
};

Tool* Tool::_inst = NULL;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pCmdLine, int nShowCmd) {
    Tool::run(hInstance, pCmdLine);
    return TRUE;
}